/**
 * 
 */
package qy.jalgotrade.optimizer;

import java.io.Serializable;

import org.apache.commons.lang3.SerializationUtils;

/**
 * @author c-geo
 *
 */
public final class Serialization {

	/**
	 * 
	 * @param obj
	 * @return
	 */
	public static byte[] dumps(Object obj) {

		return SerializationUtils.serialize((Serializable) obj);
	}

	/**
	 * 
	 * @param serialized
	 * @return
	 */
	public static <T> T loads(byte[] serialized) {

		return SerializationUtils.deserialize(serialized);
	}

	/**
	 * 
	 */
	private Serialization() {

	}
}
